﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_Popup.Master" CodeBehind="User_Popup.aspx.vb" Inherits="I_PORT.User_Popup" 
    title="IRPC INTELLIGENT PORT SERVICE" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Control/Confirm.ascx" TagName="Confirm1" TagPrefix="Confirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" language="javascript">
                var _source;
    // keep track of the popup div
    var _popup;

    function showConfirm(customerid) {
        this._source = customerid;
        this._popup = $find('ModalPopupExtender3'); 
        this._popup.show();  
    }
       function okClick(){
        //  find the confirm ModalPopup and hide it
       this._popup.hide();

        __doPostBack(this._source.name,'');
        
    }
    
    function cancelClick(){
        //  find the confirm ModalPopup and hide it
        this._popup.hide();
    }
  </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <table width="100%" border="0" cellpadding="2" cellspacing="0">
       <tr>
         <td style="width:20%;" align="right"><asp:Label ID="lbUserName" runat="server" SkinID="lbtxt" Text="User Name :"></asp:Label>&nbsp;</td>
         <td align="left"><asp:TextBox ID="txtUsername" runat="server"></asp:TextBox></td>
       </tr>
       <tr>
         <td style="width:20%;" align="right"><asp:Label ID="lbPass" runat="server" SkinID="lbtxt" Text="Password :"></asp:Label>&nbsp;</td>
         <td align="left"><asp:TextBox ID="txtPass1" runat="server" TextMode="Password"></asp:TextBox></td>
       </tr>
       <tr>
         <td style="width:20%;" align="right"><asp:Label ID="lbConfirmPass" runat="server" SkinID="lbtxt" Text="Confirm Password :"></asp:Label>&nbsp;</td>
         <td align="left"><asp:TextBox ID="txtPass2" runat="server" TextMode="Password"></asp:TextBox></td>
       </tr>
       <tr>
         <td style="width:20%;" align="right"><asp:Label ID="lbName" runat="server" SkinID="lbtxt" Text="Name :"></asp:Label>&nbsp;</td>
         <td align="left"><asp:TextBox ID="txtName" runat="server"></asp:TextBox></td>
       </tr>
       <tr>
         <td style="width:20%;" align="right"><asp:Label ID="lbEMail" runat="server" SkinID="lbtxt" Text="E-mail :"></asp:Label>&nbsp;</td>
         <td align="left"><asp:TextBox ID="txtEmail" runat="server" Width="250px"></asp:TextBox>&nbsp;<asp:Label ID="label46" runat="server" Text="กรณีมีมากกว่า 1 E-Mail ให้คั่นด้วย ;" ForeColor="Red" ></asp:Label></td>
       </tr>
       </table>
           </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
       <table width="100%" border="0" cellpadding="2" cellspacing="0">
       <tr>
         <td style="width:20%;" align="right"><asp:Label ID="Label3" runat="server" SkinID="lbtxt" Text="สิทธิ์ :"></asp:Label>&nbsp;</td>
         <td align="left">
             <asp:DropDownList ID="ddlRole" runat="server" SkinID="ddl" AutoPostBack="True" >
                <asp:ListItem>Admin</asp:ListItem>
                <asp:ListItem>Customer</asp:ListItem>
             </asp:DropDownList>
            <%-- <asp:Button ID="btnAdd" runat="server" Text="เพิ่ม" CssClass="ButtonStyle" />--%>
         </td>
       </tr>
       <%--<tr>
         <td style="width:20%;" align="right" valign="top" >&nbsp;</td>
         <td align="left"><asp:GridView ID="gridRole" runat="server" SkinID="gridblue" DataKeyNames="Role_no" Width="50%"
                     AutoGenerateColumns="False">
                     <Columns>
                         <asp:TemplateField HeaderText="ลำดับ" HeaderStyle-Wrap="false" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="35px">
                               <ItemTemplate>
                                  <%#Container.DataItemIndex+1 %>
                               </ItemTemplate>
                         </asp:TemplateField>
                         <asp:BoundField HeaderText="สิทธิ์" DataField="Role_name"/>
                         <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                 <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>"  OnClientClick="showConfirm(this); return false;" runat="server" ImageUrl="~/Image/cancel-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
                 </asp:GridView></td>
       </tr>--%>
       <tr id="rowCustomer" runat="server" visible="false">
         <td style="width:20%;" align="right"><asp:Label ID="lbCustomer" runat="server" SkinID="lbtxt" Text="ลูกค้า :"></asp:Label>&nbsp;</td>
         <td align="left">
             <asp:TextBox ID="txtid" runat="server" Width="300px"></asp:TextBox>
               <asp:AutoCompleteExtender  runat="server" ID="AutoCompleteExtender1" BehaviorID="AutoCompleteEx2" CompletionInterval="50"
                     TargetControlID="txtid" ServicePath="../WebService/AutoComplete_IPORT.asmx" MinimumPrefixLength="3" 
                    ServiceMethod="GetCustomer" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem" 
                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" >
                <Animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx2');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx2')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx2')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                </Animations>
                 </asp:AutoCompleteExtender>
         </td>
       </tr>
       <tr>
         <td style="width:20%;" align="right"><asp:Label ID="lbStatus" runat="server" SkinID="lbtxt" Text="สถานะการใช้งาน :"></asp:Label>&nbsp;</td>
         <td align="left">
             <asp:DropDownList ID="ddlStatus" runat="server" SkinID="ddl" >
                <asp:ListItem Value="Y">ใช้งาน</asp:ListItem>
                <asp:ListItem Value="N">ไม่ใช้งาน</asp:ListItem>
             </asp:DropDownList><asp:Button ID="BtnTrigger" runat="server" style="display:none;"  />
         </td>
       </tr>
       </table>
       <asp:ModalPopupExtender BehaviorID="ModalPopupExtender3" runat="server" 
           OkControlID="ctl00_contentplaceholder1_ConfirmDelete_btnOk" 
           OnOkScript="okClick();" 
           CancelControlID="ctl00_contentplaceholder1_ConfirmDelete_btnNo"     
           OnCancelScript="cancelClick();" 
           BackgroundCssClass="Background" DropShadow="false" 
           PopupControlID="PanelConfirm" TargetControlID="BtnTrigger" >
        </asp:ModalPopupExtender>
                  </ContentTemplate>
    </asp:UpdatePanel>
    <asp:Panel ID="PanelConfirm" runat="server" style="display:none;">
       <Confirm:Confirm1 ID="ConfirmDelete" runat="server" ></Confirm:Confirm1>
    </asp:Panel>
        <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
       <table width="100%" border="0" cellpadding="2" cellspacing="0">
       <tr>
         <td style="width:20%;" align="right">&nbsp;</td>
         <td align="left">
               <asp:Button ID="btnSave" runat="server" Text="บันทึก" CssClass="ButtonStyle" />
               <asp:Button ID="btnCancel" runat="server" Text="ยกเลิก" CssClass="ButtonStyle" />
         </td>
       </tr>
     </table>
                       </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
